import requests from '@/api/request'
const SERVER_URL = ''
export default {
  // 查询职务
  postQueryRoleData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/role/queryByCondition`,
      method: 'post',
      data
    })
  },
  // 查询用户
  postQueryByConditionData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/user/queryByCondition`,
      method: 'post',
      data
    })
  },
  // 添加用户
  postAddUserData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/user/add`,
      method: 'post',
      data
    })
  },
  // 用户状态更新
  postUpdateUserStatus (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/user/status/update`,
      method: 'post',
      data
    })
  },
  // 删除用户
  deleteUser (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/user/delete/${data}`,
      method: 'delete',
      data
    })
  },
  // 标签列表查询
  postQueryLabelData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/label/queryByCondition`,
      method: 'post',
      data
    })
  },
  // 新增标签
  postAddLabelData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/label/add`,
      method: 'post',
      data
    })
  },
  // 删除标签
  deleteLabelData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/label/delete/${data}`,
      method: 'delete',
      data
    })
  },
  // 标签关联人员
  postLabelRelateUserData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/label/relate/user`,
      method: 'post',
      data
    })
  },
  // 根据userid查询用户详情
  getUserDetailData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/user/queryById/${data}`,
      method: 'get',
      data
    })
  },
  // 更新用户信息
  putUserData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/user/edit`,
      method: 'put',
      data
    })
  },
  postUserRelateLabelData (data) {
    return requests({
      url: `${SERVER_URL}/v1/api/user/user/relate/label`,
      method: 'post',
      data
    })
  },
  // 重置密码
  resetUserPassword (data) {
    return requests({
      url: `/v1/api/user/user/password/reset/${data}`,
      method: 'post'
    })
  },
  // 用户数据导入
  uploadTemplate (data) {
    return requests({
      url: `/v1/api/user/user/import`,
      method: 'post',
      header: {
        'Content-type': 'multipart/form-data'
      },
      data
    })
  },
  // 冻结用户
  frozeNowUser (data) {
    return requests({
      url: `/v1/api/user/user/froze/${data}`,
      method: 'post'
    })
  },
  // 解冻用户
  unFrozeNowUser (data) {
    return requests({
      url: `/v1/api/user/user/unFroze/${data}`,
      method: 'post'
    })
  }
}
